const router = require('koa-router')()

router.get('/:aaa', async (ctx, next) => {
  await ctx.render('index', {
    title: 'Hello Koa 2!'
  })
  console.log(ctx.params);
  next()
})

router.get('/string/:aaa', async (ctx, next) => {
  ctx.body = 'koa2 strings'
  console.log(ctx.params);

})

router.get('/json', async (ctx, next) => {
  ctx.body = {
    title: 'koa2 json'
  }
})

module.exports = router
